package com.mygame.common.component;


public class Constants {
	/**
	 * vm opts
	 */
	public class Property {
		/**
		 * 配置文件根路径
		 */
		public static final String CONFIG_DIR = "litchi.config";
		/**
		 * 运行环境名称
		 */
		public static final String ENV_NAME = "litchi.env";
		/**
		 * 运行服务id
		 */
		public static final String NODE_ID = "litchi.nodeid";
		/**
		 * 资源文件根路径
		 */
		public static final String RESOURCE_DIR = "admin.resources";
	}


	/**
	 * component name
	 */
	public class Component {
		public static final String BASE_PACKAGES = "basePackages";

		public static final String DATA_CONFIG = "dataConfig";

		public static final String DB_QUEUE = "dbQueue";

		public static final String DISPATCH = "dispatch";

		public static final String JDBC = "jdbc";

		public static final String REDIS = "redis";

		public static final String ROUTE = "route";

		public static final String EVENT = "event";
	}

	public class Net {
		public static final String HTTP_SERVER = "httpServer";

		public static final String RPC_SERVER = "rpcServer";

		public static final String RPC_CLIENT = "rpcClient";

		public static final String WEB_SOCKET_SERVER = "webSocketServer";
		public static final String TCP_SOCKET_SERVER = "tcpSocketServer";
	}

	public class File {
		public static final String LITCHI_DOT_JSON = "litchi.json";
		public static final String NODES_DOT_JSON = "nodes.json";
		public static final String LOG_BACK = "logback.xml";
	}

	public static final int RESET_DAILY_DATA = 0;//每日重置数据时间为0点

	public static final int PACKAGE_SIZE_LENGTH = 4;//数据包开始用4个字节表示后续数据的长度
	public static final int COMMAND_ID_LENGTH = 4;
	public static final int EXTEND_LENGTH = 4;
	public static final int MAX_COMMAND_LENGTH =  4 * 1024 * 1024;
    
    public static final int INVALID_VALUE = -1;//无效值

    public static final String SESSION_KEY_ROOM = "KEY_ROOM";
    public static final String SESSION_KEY_PACKAGE_RATE = "KEY_PACKAGE_RATE";
    public static final String SESSION_KEY_ROOOM_ID = "ROOOM_ID";

    public final static int SUCCESS = 1;
    public final static int ERROR = -1;
    public static final int ERROR_INVALID_PARAM = -100;//无效参数
	public static final int ERROR_DATABASE = -200;//数据库错误
	public static final int ERROR_NETWORK = -201;//网络异常，请稍候再试
	public static final int ERROR_SERVER_BUSY = -202;//服务器忙，请稍候再试
	public static final int ERROR_NOT_ENOUGH_BALANCE = -1444;//蓝钻不足
	public static final int ERROR_NOT_ENOUGH_REDBALANCE = -1445;//红钻不足
	public static final int ERROR_ORDER_ID_DUPLICATE = -1472;//订单号重复
}
